package org.tailor
/**
 * The Shirt entity.
 *
 * @author    
 *
 *
 */
class Shirt {
    static mapping = {
        table 'shirt'
        // version is set to false, because this isn't available by default for legacy databases
        version false
        id generator:'identity', column:'id'
        fabricIdFabric column:'fabric_id'
        designIdDesign column:'design_id'
        tailorIdTailor column:'tailor_id'
    }
    Long id
    String monoText
    String note
    // Relation
    Fabric fabricIdFabric
    // Relation
    Design designIdDesign
    // Relation
    Tailor tailorIdTailor

    static constraints = {
        id(max: 9223372036854775807L)
        monoText(blank: false)
        note(size: 1..255, blank: false)
        fabricIdFabric()
        designIdDesign()
        tailorIdTailor()
    }
    String toString() {
        return "${designIdDesign}" 
    }
}
